import os
import time
from concurrent.futures import ProcessPoolExecutor

pp = ProcessPoolExecutor(10)


def task():
    for i in range(2):
        print("this is a _task. i = {}. process id = {}".format(i, os.getpid()))
        time.sleep(1)

    return time.time()


if __name__ == "__main__":
    futures = []
    for i in range(10):
        future = pp.submit(task)
        futures.append(future)

    for future in futures:
        print(future.result())
